#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>

void LeftRotateString(char* str, int n) {
	int len = strlen(str);
	int times = n % len;
	for (int i = 0; i < times; i++) {
		char tmp = str[0];
		for (int j = 0; j < len - 1; j++) {
			str[j] = str[j + 1];
		}
		str[len - 1] = tmp;
	}
}

int main() {
	char str[] = "ABCD";
	int k = 0;
	scanf("%d", &k);
	LeftRotateString(str, k);
	printf("%s\n", str); 
	return 0;
}